showToast({title:"",type:1})
var stationId=getParam("id");
var lon=getParam("lon");
var lat = getParam("lat");
// console.log(stationId)
// console.log(lon)
// console.log(lat)
// alert(stationId)
// alert(lon)
// alert(lat)
stationId  = "85C56EDEB1916C4DE053C964A8C0515C",
lon="113.633998";
lat="34.747242"
var app = new Vue({
    el: '#app',
    data: {
        list: [],
        tabstate: 0,
        mescroll: null,
        lon:lon,
        lat:lat,
        showApp:false,
        chargeDetail: {}, 

    },
    mounted: function() {
        this.getDetail();
    },
    methods: {
        getDetail:function(){
            $ajax.get(apiUrl.stationGet,{
                stationId:stationId,
                lon:this.lon,
                lat:this.lat
            },function(res){
                document.title=res.data.name;
                app.chargeDetail=res.data;
                app.showApp=true;
                showToast({title:"",type:2})
                // console.log(res,123)
            })
        },
        initmescroll:function(){
            if(this.mescroll)return;
            this.mescroll = new MeScroll("mescroll", { 
                up: {
                    callback:app.upCallback, 
                    page: {
                        num: 0, 
                        size: 10 
                    },
                    htmlNodata: '<p class="upwarp-nodata">-- END --</p>',
                    noMoreSize: 5
                }
            });
            this.mescroll.lockDownScroll(true);
        },
        upCallback:function(page){
            $ajax.get(apiUrl.list,{
                stationId:stationId,
                pageNum: page.num,
                pageSize: page.size,
                orderByColumn:'status',
                isAsc:'desc',
            },function(res){
                if(page.num==1){
                    app.list=[];
                }
                // console.log(res,456)
                app.mescroll.endSuccess(res.rows.length);
                app.list=app.list.concat(res.rows);
            })
            
        },
        tabclick: function(index) {
            this.tabstate = index;
            if(index==1){
                this.initmescroll();
            }
        },
        nav:function(){
            console.log(this.chargeDetail)
            var data= {
                longitude : this.chargeDetail.lon,
                latitude : this.chargeDetail.lat,
                destination : this.chargeDetail.name,
                mapNaviType:1,// 0线路规划  1导航
            }
            openMapAutoNavi(data);
        }

    }

})
		       	